<script setup>
import { ref } from 'vue'

import {Button, TabPane, Tabs} from 'ant-design-vue'

import Handtable from './Handtable.vue'
import materialData from './materialData.vue'
import processData from './processData.vue'

const props = defineProps({
  params: Object,
})

const value = ref(props.params?.value ?? '')
const row = ref(props.params.data)

const getValue = () => row.value.process_name
function  add(){
  let newData = {
    ...props.params.data,
    orderNum:Math.random(),
  }
  props.params.node.setData(newData)
  props.params.api.refreshCells({rowNodes:[props.params.node]})

  console.log(props.params)
}
</script>

<template>
  <div>
<!--    <Button type="primary" @click="add">保存</Button>-->
    <Tabs class="mt-1">
      <TabPane key="tab1" tab="分仓信息" style="padding: 10px">
        <Handtable v-model="row.orderWareList" :id="row.id" />
      </TabPane>
      <TabPane key="tab2" tab="物料信息" style="padding: 10px">
        <materialData v-model="row.bomList.materialData" />
      </TabPane>
      <TabPane key="tab3" tab="生产工序" style="padding: 10px">
        <processData v-model="row.bomList.processData" />
      </TabPane>
    </Tabs>
  </div>
</template>

<style scoped>
input {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}
</style>
